package com.reader.cms.entity.magazine;

import java.io.Serializable;

import java.math.BigDecimal;
import java.util.Date;

import com.baomidou.mybatisplus.annotations.TableField;
import com.baomidou.mybatisplus.activerecord.Model;
import com.baomidou.mybatisplus.annotations.TableId;
import com.baomidou.mybatisplus.annotations.TableName;

import java.io.Serializable;
import java.util.List;

import com.baomidou.mybatisplus.enums.IdType;
import com.reader.core.validator.group.AddGroup;
import com.reader.core.validator.group.UpdateGroup;
import io.swagger.models.auth.In;
import org.springframework.format.annotation.DateTimeFormat;
import com.baomidou.mybatisplus.annotations.TableName;

import javax.validation.constraints.NotBlank;
import javax.validation.constraints.NotNull;

/**
 * @author gumenghao
 * @@description
 * @date 2018-10-23
 */
@TableName("reader_magazine")
public class ReaderMagazine extends Model<ReaderMagazine> {

    private static final long serialVersionUID = 1L;


    @TableId(value = "id", type = IdType.INPUT)
    private String id;

    /**
     * 年份
     */

    @NotNull(message="杂志年限不能为空！！！", groups = {AddGroup.class, UpdateGroup.class})
    private Integer year;

    /**
     * 刊期
     */

    @NotBlank(message="杂志期数不能为空！！！", groups = {AddGroup.class, UpdateGroup.class})
    private String period;

    /**
     * 刊号
     */

    @NotNull(message="刊号不能为空！！！", groups = {AddGroup.class, UpdateGroup.class})
    private Integer number;

    /**
     * 封面图片
     */

    @NotBlank(message="封面图不能为空！！！", groups = {AddGroup.class, UpdateGroup.class})
    private String cover;

    /**
     * 发布时间
     */

    @NotNull(message="发布时间不能为空！！！", groups = {AddGroup.class, UpdateGroup.class})
    @TableField("publish_dt")
    @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    private Date publishDt;

    /**
     * 公共代码：CONT_STAT内容状态,Publish 发布，withdraw下架，quartz定时，
     */


    private String state;

    /**
     * 杂志介绍
     */


    private String introduction;

    /**
     * 商品实际价格
     */

    @NotNull(message="商品价格不能为空！！！", groups = {AddGroup.class, UpdateGroup.class})
    private BigDecimal price;

    /**
     * 划线价格 相当于原价
     */

    @TableField("lineation_price")

    private BigDecimal lineationPrice;


    private Integer enable;


    @TableField("del_flag")

    private Integer delFlag;


    @TableField("insert_dt")

    @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    private Date insertDt;


    @TableField("insert_user_id")

    private Integer insertUserId;


    @TableField("updt_dt")

    @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    private Date updtDt;


    @TableField("updt_user_id")

    private Integer updtUserId;

    @TableField(exist = false)
    private Integer contentNum;

    @TableField(exist = false)
    private String stateNm;

    @TableField(exist = false)
    private String promulgator;

    @NotNull(message="关联栏目不能为空！！！", groups = {AddGroup.class, UpdateGroup.class})
    @TableField(exist = false)
    private List<Integer> columnIds;

    public String getId() {
        return id;
    }

    public void setId(String id) {
        this.id = id;
    }

    public Integer getYear() {
        return year;
    }

    public void setYear(Integer year) {
        this.year = year;
    }

    public String getPeriod() {
        return period;
    }

    public void setPeriod(String period) {
        this.period = period;
    }

    public Integer getNumber() {

        return number;
    }

    public void setNumber(Integer number) {
        this.number = number;
    }

    public String getCover() {
        return cover;
    }

    public void setCover(String cover) {
        this.cover = cover;
    }

    public Date getPublishDt() {
        return publishDt;
    }

    public void setPublishDt(Date publishDt) {
        this.publishDt = publishDt;
    }

    public String getState() {
        return state;
    }

    public void setState(String state) {
        this.state = state;
    }

    public String getIntroduction() {
        return introduction;
    }

    public void setIntroduction(String introduction) {
        this.introduction = introduction;
    }

    public BigDecimal getPrice() {
        return price;
    }

    public void setPrice(BigDecimal price) {
        this.price = price;
    }

    public BigDecimal getLineationPrice() {
        return lineationPrice;
    }

    public void setLineationPrice(BigDecimal lineationPrice) {
        this.lineationPrice = lineationPrice;
    }

    public Integer getEnable() {
        return enable;
    }

    public void setEnable(Integer enable) {
        this.enable = enable;
    }

    public Integer getDelFlag() {
        return delFlag;
    }

    public void setDelFlag(Integer delFlag) {
        this.delFlag = delFlag;
    }

    public Date getInsertDt() {
        return insertDt;
    }

    public void setInsertDt(Date insertDt) {
        this.insertDt = insertDt;
    }

    public Integer getInsertUserId() {
        return insertUserId;
    }

    public void setInsertUserId(Integer insertUserId) {
        this.insertUserId = insertUserId;
    }

    public Date getUpdtDt() {
        return updtDt;
    }

    public void setUpdtDt(Date updtDt) {
        this.updtDt = updtDt;
    }

    public Integer getUpdtUserId() {
        return updtUserId;
    }

    public void setUpdtUserId(Integer updtUserId) {
        this.updtUserId = updtUserId;
    }

    public Integer getContentNum() {
        return contentNum;
    }

    public void setContentNum(Integer contentNum) {
        this.contentNum = contentNum;
    }

    public String getStateNm() {
        return stateNm;
    }

    public void setStateNm(String stateNm) {
        this.stateNm = stateNm;
    }

    public String getPromulgator() {
        return promulgator;
    }

    public void setPromulgator(String promulgator) {
        this.promulgator = promulgator;
    }

    public List<Integer> getColumnIds() {
        return columnIds;
    }

    public void setColumnIds(List<Integer> columnIds) {
        this.columnIds = columnIds;
    }

    @Override
    protected Serializable pkVal() {
        return this.id;
    }

    @Override
    public String toString() {
        return "ReaderMagazine{" +
                ", id=" + id +
                ", year=" + year +
                ", period=" + period +
                ", num=" + number +
                ", cover=" + cover +
                ", publishDt=" + publishDt +
                ", state=" + state +
                ", introduction=" + introduction +
                ", price=" + price +
                ", lineationPrice=" + lineationPrice +
                ", enable=" + enable +
                ", delFlag=" + delFlag +
                ", insertDt=" + insertDt +
                ", insertUserId=" + insertUserId +
                ", updtDt=" + updtDt +
                ", updtUserId=" + updtUserId +
                "}";
    }
}